import os.path as osp
from utils.utility import getLogger

logger = getLogger(__name__)


def check_dataset(dataset_path) -> bool:
    if osp.isdir(dataset_path) and \
       osp.isdir(osp.join(dataset_path, "train")) and \
       osp.isdir(osp.join(dataset_path, "val")) and \
       osp.isdir(osp.join(dataset_path, "test")):
        return True
    else:
        logger.error(f"Dataset '{dataset_path.split('/')[-1]}' does not exist, ABORT")
        return False